<template>
  <el-dialog v-model="dialogFormVisible" title='温馨提示' width="30%">
    <span>您确定清空操作日志吗 ?</span>
    <template #footer>
      <span class="dialog-footer">
        <el-button @click="dialogFormVisible = false">
          取消
        </el-button>
        <el-button type="primary" @click="confirmDelete">
          确定
        </el-button>
      </span>
    </template>
  </el-dialog>
</template>

<script lang="ts" setup>
import { ref } from 'vue'
import { ElMessage } from 'element-plus'
import { clearOperationLogListAPI } from '../../../api/operate_log'


const confirmDelete = async () => {
  const res = await clearOperationLogListAPI()
  if (res.data.status === 0) {
    ElMessage({
      message: '清空操作日志成功',
      type: 'success'
    })
    dialogFormVisible.value = false
  }

}







// 弹窗开关
const dialogFormVisible = ref(false)

// 打开删除管理员的弹窗
const open = () => {
  dialogFormVisible.value = true
}

defineExpose({
  open
})

</script>

<style lang="scss" scoped></style>